package com.jy.rhin.model;

import com.jy.rhin.infra.cda.XPath;
import com.jy.rhin.infra.cda.XValid;
import com.jy.rhin.model.body.siwangyxzm.JiaRen;
import com.jy.rhin.model.header.Author;
import com.jy.rhin.model.header.Custodian;
import com.jy.rhin.model.header.PatientRole;
import com.jy.rhin.valid.DT8Valid;
import com.jy.rhin.valid.NullableValid;
import lombok.Data;

/**
 * @Author 姚俊
 * @Date 2023/2/2 17:25
 * @Description CDA文档数据模型
 */
@Data
public class ClinicalDocumentData {

    //文档创建时间
    @XPath(path = "/effectiveTime/@value"
    , xValid = @XValid(type = "node", nodeValidator = {NullableValid.class, DT8Valid.class}))
    String effectiveTime;
    //文档集合编号，用以追踪修订版次。其值由系统自动产生
    @XPath(path = "/setId/text()")
    String setId;
    //版本号
    @XPath(path = "/versionNumber/text()")
    String versionNumber;
    //患者角色
    @XPath(path = "/recordTarget/patientRole")
    PatientRole patientRole;
    //文档创建者
    @XPath(path = "/author")
    Author author;
    //文档管理机构
    @XPath(path = "/custodian")
    Custodian custodian;
    
    @XPath(path = "/title/text()")
    String title;
    
    @XPath(path = "/templateId/@root")
    String templateId;
    
    @XPath(path = "/id/@extension")
    String id;

}
